package cn.qianyan.service.Impl;


import cn.qianyan.beans.UserRight;
import cn.qianyan.dao.MenuManaDao;
import cn.qianyan.service.MenuManaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author:
 * @createDate:
 * @description:
 */
@Service
public class MenuManaServiceImpl implements MenuManaService {

    @Autowired
    private MenuManaDao menuManaDao;


    @Override
    public List<UserRight> showAll() {
        List<UserRight> userRights = menuManaDao.showAll();
        return userRights;
    }

    @Override
    public int updateMenu(UserRight userRight) {
        int i = menuManaDao.updateMenu(userRight);
        if(i>0){
            return 0;
        }
        return 10025;
    }

    @Override
    public UserRight selectSingle(int role) {
        UserRight userRight = menuManaDao.selectSingle(role);
        return userRight;
    }
}
